package controllers;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

import beans.LoginBeanRemote;

import dto.RepositoryDTO;

@ManagedBean(name="refresh")
@SessionScoped
public class RefreshSessionVarsController {
	
	@EJB
	LoginBeanRemote lbr;
	
	@ManagedProperty(value="#{repositoryDTO}")
	private RepositoryDTO rep;
	
	public RepositoryDTO getRep() {
		return rep;
	}
	public void setRep(RepositoryDTO rep) {
		this.rep = rep;
	}

	public String goToHome() {
		rep.setSupName(lbr.findSupervisor(rep.getId()));
		
		return "/userPage.xhtml";
	}
	
}
